<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:a="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>

    <h:form id="gamesetGame" styleClass="edit">
    
        <rich:panel>
            <f:facet name="header">#{gamesetGameHome.managed ? 'Edit' : 'Add'} GamesetGame</f:facet>


            <s:decorate id="gameSetIdDecoration" template="layout/edit.xhtml">
                <ui:define name="label">gameSetId</ui:define>
                <h:inputText id="gameSetId"
                       required="true"
                       disabled="#{gamesetGameHome.managed}"
                          value="#{gamesetGameHome.instance.id.gameSetId}">
                    <a:support event="onblur" reRender="gameSetIdDecoration" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>

            <s:decorate id="gamesIdDecoration" template="layout/edit.xhtml">
                <ui:define name="label">gamesId</ui:define>
                <h:inputText id="gamesId"
                       required="true"
                       disabled="#{gamesetGameHome.managed}"
                          value="#{gamesetGameHome.instance.id.gamesId}">
                    <a:support event="onblur" reRender="gamesIdDecoration" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


        
            <div style="clear:both">
                <span class="required">*</span> 
                required fields
            </div>
            
        </rich:panel>
                
        <div class="actionButtons">

            <h:commandButton id="save" 
                          value="Save" 
                         action="#{gamesetGameHome.persist}"
                       disabled="#{!gamesetGameHome.wired}"
                       rendered="#{!gamesetGameHome.managed}"/>  
                          			  
            <h:commandButton id="update" 
                          value="Save" 
                         action="#{gamesetGameHome.update}"
                       rendered="#{gamesetGameHome.managed}"/>
                        			  
            <h:commandButton id="delete" 
                          value="Delete" 
                         action="#{gamesetGameHome.remove}"
                      immediate="true"
                       rendered="#{gamesetGameHome.managed}"/>
                    
            <s:button id="done" 
                   value="Done"
             propagation="end"
                    view="/GamesetGame.xhtml"
                rendered="#{gamesetGameHome.managed}"/>
                
            <s:button id="cancel" 
                   value="Cancel"
             propagation="end"
                    view="/#{empty gamesetGameFrom ? 'GamesetGameList' : gamesetGameFrom}.xhtml"
                rendered="#{!gamesetGameHome.managed}"/>

        </div>
    </h:form>

<rich:tabPanel switchType="ajax">
    
    <rich:tab label="game *" labelClass="required">
    <div class="association" id="gameParent">
    
        <h:outputText value="There is no game associated with this gamesetGame." 
                   rendered="#{gamesetGameHome.instance.game == null}"/>
        
        <rich:dataTable var="game" 
                   value="#{gamesetGameHome.instance.game}" 
                rendered="#{gamesetGameHome.instance.game != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="gameTable">
            <h:column>
                <f:facet name="header">id</f:facet>
                #{game.id}
            </h:column>
            <h:column>
	    	    <f:facet name="header">alley id</f:facet>
		    	#{game.alley.id}
            </h:column>
            <h:column>
                <f:facet name="header">date</f:facet>
                #{game.date}
            </h:column>
            <h:column>
                <f:facet name="header">detailLevel</f:facet>
                #{game.detailLevel}
            </h:column>
            <h:column>
                <f:facet name="header">lane</f:facet>
                #{game.lane}
            </h:column>
            <h:column>
                <f:facet name="header">levelOneDetails</f:facet>
                #{game.levelOneDetails}
            </h:column>
            <h:column>
                <f:facet name="header">levelTwoDetails</f:facet>
                #{game.levelTwoDetails}
            </h:column>
            <h:column>
	    	    <f:facet name="header">player id</f:facet>
		    	#{game.player.id}
            </h:column>
            <h:column>
                <f:facet name="header">result</f:facet>
                #{game.result}
            </h:column>
            <h:column>
                <f:facet name="header">style</f:facet>
                #{game.style}
            </h:column>
            <h:column>
                <f:facet name="header">action</f:facet>
                <s:link view="/Game.xhtml" 
                         id="viewgame" 
                      value="View" 
                propagation="none">
                    <f:param name="gameId" 
                           value="#{game.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

        <div class="actionButtons">
            <s:button value="Select game"
                       view="/GameList.xhtml">
                <f:param name="from" value="GamesetGameEdit"/>
            </s:button>
        </div>
        
    </div>
    </rich:tab>
    
    <rich:tab label="gameset *" labelClass="required">
    <div class="association" id="gamesetParent">
    
        <h:outputText value="There is no gameset associated with this gamesetGame." 
                   rendered="#{gamesetGameHome.instance.gameset == null}"/>
        
        <rich:dataTable var="gameset" 
                   value="#{gamesetGameHome.instance.gameset}" 
                rendered="#{gamesetGameHome.instance.gameset != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="gamesetTable">
            <h:column>
                <f:facet name="header">id</f:facet>
                #{gameset.id}
            </h:column>
            <h:column>
                <f:facet name="header">description</f:facet>
                #{gameset.description}
            </h:column>
            <h:column>
	    	    <f:facet name="header">event id</f:facet>
		    	#{gameset.event.id}
            </h:column>
            <h:column>
                <f:facet name="header">name</f:facet>
                #{gameset.name}
            </h:column>
            <h:column>
	    	    <f:facet name="header">player id</f:facet>
		    	#{gameset.player.id}
            </h:column>
            <h:column>
                <f:facet name="header">action</f:facet>
                <s:link view="/Gameset.xhtml" 
                         id="viewgameset" 
                      value="View" 
                propagation="none">
                    <f:param name="gamesetId" 
                           value="#{gameset.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

        <div class="actionButtons">
            <s:button value="Select gameset"
                       view="/GamesetList.xhtml">
                <f:param name="from" value="GamesetGameEdit"/>
            </s:button>
        </div>
        
    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
